* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #1a1a1a;
    color: #fff;
    overflow: hidden;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}

.screen.active {
    display: flex;
}

/* 登录界面 */
.login-box, .room-box {
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

h1 {
    color: #0f0;
    margin-bottom: 30px;
    font-size: 24px;
    text-shadow: 0 0 10px #0f0;
}

input[type="text"] {
    background: #111;
    border: 1px solid #333;
    color: #0f0;
    padding: 10px;
    margin: 5px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

button {
    background: #333;
    color: #0f0;
    border: 1px solid #555;
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
}

button:hover {
    background: #555;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* 游戏界面 */
#game-canvas {
    width: 100%;
    height: 100%;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.inventory {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    pointer-events: auto;
    width: 200px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-bottom: 20px;
}

.inventory-slot {
    width: 40px;
    height: 40px;
    background: #222;
    border: 1px solid #444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
}

.inventory-slot:hover {
    border-color: #0f0;
}

.crafting-area h3 {
    color: #0f0;
    margin-bottom: 10px;
}

.crafting-recipe {
    background: #222;
    border: 1px solid #444;
    padding: 5px;
    margin: 2px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.crafting-recipe:hover {
    background: #333;
}

#player-info {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.room-list {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.room-item {
    background: #333;
    margin: 5px 0;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
}

.room-item:hover {
    background: #444;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .inventory {
        right: 5px;
        width: 150px;
    }
    
    .inventory-slot {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }
}